<template>
  <div id="app">
    <router-view />
  </div>
</template>
<script>
import { mapMutations } from "vuex";
export default {
  mounted: function () {
    let currentUser = JSON.parse(localStorage.getItem("initCurrenUser"));
    // console.log(currentUser);
    if (currentUser != null) {
      this.initCurrenUser(currentUser);
    } else {
      this.$router.replace("/login");
    }
  },
  methods: {
    ...mapMutations(["initCurrenUser"]),
  },
};
</script>

<style lang="scss">
* {
  margin: 0;
  padding: 0;
}
html,
body,
#app {
  height: 100%;
}
</style>
